#ifndef SDLINPUT_H
#define SDLINPUT_H

#include "Input.h"

#include <SDL/SDL.h>

namespace GenBen {

class SDLInput : public Input
{
public:
	SDLInput();
	virtual ~SDLInput();

	// Keyboard
	virtual bool isKeyPressed(Key key);
	virtual bool isKeyUp(Key key);
	virtual bool isKeyDown(Key key);

	// Mouse
	virtual VectorI getMousePos();
	virtual VectorI getMouseRelativePos();
	virtual int getRelativeWheel();
	virtual bool isMouseButtonPressed(MouseButton button);
	virtual bool isMouseButtonUp(MouseButton button);
	virtual bool isMouseButtonDown(MouseButton button);

	bool process(const SDL_Event& evt);
	void update();

private:
	bool keyboard[256];
	bool keyboard_current[256];
	bool keyboard_last[256];

	bool mouse[3];
	bool mouse_current[3];
	bool mouse_last[3];

	VectorI mouse_pos, mouse_pos_old;
};

}

#endif
